﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Address.cs" company="DissingNelleman">
//   
// All rights reserved. </copyright>
// <summary>
//   The address.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace ServiceLibrary.Models.Domain
{
    using NHibernate.Mapping.ByCode.Conformist;

    using ServiceLibrary.Models.Base;

    /// <summary>
    /// The address.
    /// </summary>
    public class Address : Entity
    {
        #region Public Properties

        /// <summary>
        /// Gets or sets the att.
        /// </summary>
        public virtual string Att { get; set; }

        /// <summary>
        /// Gets or sets the city.
        /// </summary>
        public virtual string City { get; set; }

        /// <summary>
        /// Gets or sets the street name.
        /// </summary>
        public virtual string StreetName { get; set; }

        /// <summary>
        /// Gets or sets the street nr.
        /// </summary>
        public virtual string StreetNr { get; set; }

        /// <summary>
        /// Gets or sets the zip.
        /// </summary>
        public virtual string Zip { get; set; }

        #endregion
    }

    /// <summary>
    /// The address mapping.
    /// </summary>
    public class AddressMapping : ClassMapping<Address>
    {
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="AddressMapping"/> class.
        /// </summary>
        public AddressMapping()
        {
            // ManyToOne(x => x.FrontPageImage);

            // Set(x => x.Images, c => { }, m => m.ManyToMany());
            // Property(x => x.ShortName, m => m.Index("idx_ShortName"));
            // Property(x => x.Att, m => m.Length(int.MaxValue / 2));
            this.Property(x => x.Att);
            this.Property(x => x.StreetName);
            this.Property(x => x.StreetNr);
            this.Property(x => x.Zip);
            this.Property(x => x.City);
        }

        #endregion
    }
}